export function set(key,value){
    localStorage.setItem(key,JSON.stringify(value));
  }

  export function get(key){
    return JSON.parse(localStorage.getItem(key));
  }

  export function remove(key){
    localStorage.removeItem(key);
  }

  export function clear(){
    localStorage.clear();
  }

  //获取地址栏参数
export function UrlSearch(tag){
  console.log(tag);
  var name,value; 
  var str=window.location.href; //取得整个地址栏
  var num=str.indexOf("?") 
  str=str.substr(num+1); //取得所有参数   stringvar.substr(start [, length ]
  var arr=str.split("&"); //各个参数放到数组里
  for(var i=0;i < arr.length;i++){ 
      num=arr[i].indexOf("="); 
      if(num>0){
          name=arr[i].substring(0,num);
          value=arr[i].substr(num+1);
          if(name === tag){
              return value;
          }
      }
  }
}